/**
 * Created by vicket on 2017/4/16.
 */
$(function(){
    var userName=$(".user_name");
    var exitImmediately=$(".exit_immediately");
    userName.text(sessionStorage.username);

    if(sessionStorage.username){
        exitImmediately.text("退出当前登录");
    }else{
        exitImmediately.text("登录");
    }
    exitImmediately.click(function(){
        sessionStorage.removeItem("username");
        sessionStorage.removeItem("userId");
    });
    var userId = sessionStorage.getItem("userId");
    var myshare=$(".share");
    if(userId){
        myshare.attr("href","myshare.ejs");
    }
})